package com.example.user.myapply

import com.example.base.mvi.BaseViewModel
import com.example.base.mvi.HttpType
import com.example.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class MyApplyViewModel @Inject constructor(val apiService: ApiService):BaseViewModel<MyApplyIntent>() {
    override fun handleIntent(it: MyApplyIntent) {
        when(it){
            is MyApplyIntent.getPark -> httpRequest(apiService.parkType(it.spaceType),HttpType.DEFAULT)
            MyApplyIntent.getRepair -> httpRequest(apiService.repair(),HttpType.REPAIR)
            MyApplyIntent.getVisit -> httpRequest(apiService.visit(),HttpType.VISIT)
        }
    }
}